<?php
include_once "Commodity.php";

class Book extends Commodity
{
    private $author;                //作者
    private $publisher;             //出版社

    function __construct($name,$price,$inventory,$author,$publisher)
    {
        parent::__construct();
        $this->setName($name);
        $this->setPrice($price);
        $this->setInventory($inventory);
        $this->setAuthor($author);
        $this->setPublisher($publisher);
    }
    function __destruct()
    {
        parent::__destruct(); // TODO: Change the autogenerated stub
    }

    public function showInfo()
    {
        // TODO: Implement showInfo() method.
        echo "产品名字：".$this->getName()."<br>";
        echo "产品价格：".$this->getPrice()."<br>";
        echo "产品库存：".$this->getInventory()."<br>";
        echo $this->getName()."的作者是：".$this->getAuthor()."<br>";
        echo $this->getName()."的出版社是：".$this->getPublisher()."<br>";
    }

    /**
     * @return mixed
     */
    public function getAuthor()
    {
        return $this->author;
    }

    /**
     * @return mixed
     */
    public function getPublisher()
    {
        return $this->publisher;
    }

    /**
     * @param mixed $author
     */
    public function setAuthor($author)
    {
        $this->author = $author;
    }

    /**
     * @param mixed $publisher
     */
    public function setPublisher($publisher)
    {
        $this->publisher = $publisher;
    }
}